/**
 * @Author wangyl
 * @E-mail wangyl0629@foxmail.com
 **/
package com.wyl.xue.admin.conf;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @ClassName: AdminProperties
 * @Function: 自动装配扫描
 * @Date: 2020/11/8 0:14
 * @author wyl
 * @version V1.0
 */
@ComponentScan("com.wyl.xue.admin.*")
@MapperScan({"com.wyl.xue.admin.system.mybatis.mapper"})
@EnableTransactionManagement
@ConditionalOnProperty(prefix = "admin", name = "enable", havingValue = "true")
@Configuration
public class AdminProperties {
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInterceptor();
    }
}
